# # -*- coding: utf-8 -*-
# from datetime import timedelta
# from utils.operators.spark_submit import SparkSubmitOperator
# from jms.time_sensor import time_after_01_30
#
# nowdt = '{{ execution_date | cst_ds }}'
# nextdt = '{{ execution_date | date_add(1) | cst_ds }}'
# # nowdt = '{{ execution_date | date_add(1) | cst_ds }}'
# filepath = f"/FinancialDataSync/spmi_operation_bill/{nowdt}*"
# filepath1 = f"/FinancialDataSync/spmi_operation_bill/{nextdt}--00"
# table = "spmi_ods.spmi_operation_bill"
# outfilenum = "88"
#
# spmi_ods__spmi_operation_bill_load = SparkSubmitOperator(
#     task_id='spmi_ods__spmi_operation_bill_load',
#     email=['songjun@yl-scm.com','wangbiao@yl-scm.com'],
#     name='spmi_ods__spmi_operation_bill_load_{{ execution_date | date_add(1) | cst_ds }}',
#     pool_slots=1,
#     execution_timeout=timedelta(hours=1),
#     driver_cores=2,
#     driver_memory='4G',
#     executor_cores=2,
#     executor_memory='4G',
#     num_executors=3,
#     conf={'spark.dynamicAllocation.enabled': 'true',  # 动态资源开启
#           'spark.shuffle.service.enabled': 'true',  # 动态资源 Shuffle 服务开启
#           'spark.dynamicAllocation.maxExecutors': 56,  # 动态资源最大扩容 Executor 数
#           'spark.dynamicAllocation.cachedExecutorIdleTimeout': 60,  # 动态资源自动释放闲置 Executor 的超时时间(s)
#           'spark.sql.sources.partitionOverwriteMode': 'dynamic',  # 允许删改已存在的分区
#           'spark.executor.memoryOverhead': '2G',  # 堆外内存
#           'spark.sql.shuffle.partitions': 1200,
#           },
#     java_class='com.yunlu.bigdata.jobs.stageclean.MysqlDataHandle',  # spark 主类
#     application='hdfs:///scheduler/jms/spark/chp/spmi/spmi/spmiloadods/MysqlDataHandle.jar',  # spark jar 包
#     yarn_queue='pro',
#     application_args=[filepath,filepath1,table,nowdt,outfilenum],
# )
# spmi_ods__spmi_operation_bill_load << time_after_01_30
